﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Gnosis.Babel;

namespace Gnosis.SQLite.Clauses
{
    public class Case
        : Value
    {
        public Case(IList<CaseWhen> cases, CaseElse elseCase)
            : base("CASE", string.Empty, "END")
        {
            AddChildren<CaseWhen>(cases);
            AddChild(elseCase);
        }

        public Case(IExpression baseCase, IList<CaseWhen> cases, CaseElse elseCase)
            : base("CASE", string.Empty, "END")
        {
            AddChild(baseCase);
            AddChildren<CaseWhen>(cases);
            AddChild(elseCase);
        }
    }
}
